<?php
class CurrentUser{
    protected $username;
    protected $password;
    protected $role;
    protected $id;
   // protected $mapper;
    protected $salt;

    function __construct($user){
        $u = new UserModel();
        $user = $u->find($_SESSION['id']);
        
        $this   ->setId($user->getId())
                ->setUsername($user->getUsername())
                ->setPassword($user->Password())
                ->setSalt($user->getSalt())
                ->setRole($user->getRole());
    }


    public function setUsername($_username){
        $this->username = $_username;
        return $this;
    }
    public function getUsername(){
        return $this->username;
    }



    public function setPassword($_password){
        $this->password = $_password;
        return $this;
    }
    public function getPassword(){
        return $this->password;
    }

    public function setId($_id){
        $this->id = $_id;
        return $this;
    }
    public function getId(){
        return $this->id;
    }

    public function setRole($_role){
        $this->role = $_role;
        return $this;
    }
    public function getRole(){
        return $this->role;
    }

    public function setSalt($_salt){
        $this->salt = $_salt;
        return $this;
    }
    public function getSalt(){
        return $this->salt;
    }
}
?>
